package com.gxgeek.utils;

import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;

import java.io.IOException;
import java.util.concurrent.TimeoutException;

/**
 * @author gaoxing
 * @create 2018-05-17 下午2:21
 */
public class ConnectionUtil {
    private static final String IP = "localhost";
    public static Connection getConnection() throws IOException, TimeoutException {
        ConnectionFactory factory = new ConnectionFactory();
        factory.setHost(IP);
        Connection connection = factory.newConnection();
        return connection;
    }
}
